#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QDebug>
#include <QString>
#include <QMessageBox>

#include <string>
#include <vector>

#include <math.h>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

enum NumberSystem{
    NUMBERSYSTEM_BIN=2,
    NUMBERSYSTEM_OCT=8,
    NUMBERSYSTEM_DEC=10,
    NUMBERSYSTEM_HEX=16,
    NUMBERSYSTEM_UNDEFINE=-1
};

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    int get_NumberSystem();

public slots:
    void check_OtherNumberSystem(bool checked);

    void edit_Input(const QString &text);

    void button_StartTransfer();

    //void edit_Output();
private:

    bool CheckInput(QString in);

    void Bin2Dec(QString in, QString &out);

    void Oct2Dec(QString in, QString &out);

    void Hex2Dec(QString in, QString &out);

    void Dec2Bin(QString in, QString &out);

    void Dec2Oct(QString in, QString &out);

    void Dec2Hex(QString in, QString &out);

    void N2Dec(QString in, QString &out);

    void Dec2N(QString in, QString &out);
private:
    Ui::MainWindow *ui;

    NumberSystem number_system_;

    QString input_str_;
    QString output_str_;
};
#endif // MAINWINDOW_H
